if(!dojo._hasResource['vifito.galdic.WSGalizionario']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource['vifito.galdic.WSGalizionario'] = true;
/*
dojo.require('vifito.galdic.WSGalizionario');
wsg = new vifito.galdic.WSGalizionario();

function showResult(p) {
console.log(p);
}
dojo.subscribe('WSGalizionario.opensearch', showResult);
dojo.subscribe('WSGalizionario.query', showResult);
dojo.subscribe('WSGalizionario.parse', showResult);
*/

dojo.provide('vifito.galdic.WSGalizionario');

dojo.require("dojo.io.script"); // for cross domain JSONP
dojo.require("dojox.rpc.Service");    

dojo.declare("vifito.galdic.WSGalizionario", null, {
    
    constructor: function() {
        var mu = dojo.moduleUrl("vifito.rpc.SMDLibrary", "galizionario-v2.smd");
        this.rpcGalizionario = new dojox.rpc.Service(mu);
    },

    opensearch: function(q) {
        this.rpcGalizionario.opensearch({
            search: q
        }).addCallback(this, function(result){
            dojo.publish("WSGalizionario.opensearch", [result]);
        });        
    },            

    query: function(q) {
        this.rpcGalizionario.query({
            titles: q
        }).addCallback(this, function(result){
            dojo.publish("WSGalizionario.query", [result]);
        });        
    },            

    parse: function(q) {
        this.rpcGalizionario.parse({
            page: q 
        }).addCallback(this, function(result){
            dojo.publish("WSGalizionario.parse", [result]);
        });        
    }   
});


}
